import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import router from './router/index'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入图标字体文件
import '../src/assets/icons-1.8.1/font/bootstrap-icons.css'
import "./iconfont/iconfont.css";
import 'element-ui/lib/theme-chalk/index.css';
import store from './vuex/store'
// import VueSocketIO from 'vue-socket.io'
// import SocketIO from 'socket.io-client'
Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.use(VueRouter)
Vue.use(ElementUI);


// 封装
import request from './api/request'
Vue.prototype.$http = request
// 创建websocket实例
// const ws = new WebSocket("ws://192.168.137.1:8889");
// Vue.prototype.$ws = ws
// createApp(App).use(router).mount('#app')

// 允许跨域
// axios.defaults.withCredentials = true

import {
    createSocket
} from './api/websocket'
createSocket('ws://192.168.137.1:8889')

new Vue({
    el: "#app",
    render: h => h(App),
    router: router,
    store: store,
    beforeCreate() {
        Vue.prototype.$bus = this //安装全局事件总线
    }
})